<!DOCTYPE html>
<html lang="zh-CN" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<head th:include="/common/inc::header"/>
<body>
<form class="layui-form" style="margin-top: 15px">
    <div class="layui-form-item">
        <label class="layui-form-label" style="width: 50px">昵称:</label>
        <div class="layui-input-inline">
            <input type="text" name="nickName" id="nickName" autocomplete="off"
                   class="layui-input">
        </div>
        <label class="layui-form-label" style="width: 40px">号码:</label>
        <div class="layui-input-inline">
            <input type="text" name="account" id="account" autocomplete="off"
                   class="layui-input">
        </div>
        <button class="layui-btn" id="searchBtn" lay-submit lay-filter="searchBtn">查询</button>
    </div>
</form>
<table class="layui-table" id="grid" lay-filter="grid">
</table>
<script th:replace="/common/inc::incJs"></script>
<script>
    var id = getQueryString("id");

    $(function () {
        var tableIns = createTable({
            url: 'list?parentCustomerId=' + id,
            cols: [[
                {field: 'nickName', title: '昵称', width: 160}, {field: 'userName', title: '姓名', width: 160}
                , {field: 'account', title: '账号', width: 160}
            ]]
        });

        layui.form.on('submit(searchBtn)', function (data) {
            tableIns.reload({
                where: data.field
            });
            return false;
        });
    })
</script>
</body>
</html>
